# -*- coding: UTF-8 -*-

import time

from gpiozero import MotionSensor

def main():
    print("{1}=== Sensor Detect Start ===", )
    
    # setup motion sensor
    pir = MotionSensor("BOARD7")
    while True:
        pir.wait_for_motion()
        print("[{0}] Motion Detected".format(time.ctime()))
        time.sleep(2)


if __name__ == "__main__":
    main()